package cn.biplam.front.component.view.mdManage;

import cn.biplam.common.client.DataFilter;
import cn.biplam.common.client.Operator;
import cn.biplam.common.opcode.mdManage.TypeCode.ModelTypeCode;
import cn.biplam.common.struc.MdStruc;
import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.common.wrapper.UserInfo;
import cn.biplam.common.wrapper.sqlresult.SqlResult;
import cn.biplam.front.component.data.common.SelectComp;
import cn.biplam.front.html.base.HtmlWindow;

/**
 * 数据库类型下拉列表组件
 * @author XiaoRuxing 2009-6-30下午04:35:58
 * @version 1.0
 */
public class ModelTypeSelect {

	/**
	 * 获取数据源下拉列表
	 * @param listPageID   页面ID
	 * @param defaultValue 默认值
	 * @param mUser        用户
	 * @param sHomeUrl     应用系统路径
	 * @return
	 * @throws ErrorMessage
	 */
	public static HtmlWindow get(String listPageID,
			String defaultValue,
			UserInfo mUser,
			String sHomeUrl) throws ErrorMessage{
		SqlResult dbTypes=Operator.get(ModelTypeCode.Select_All_Type, mUser.getUserID(), new DataFilter()).getSelectResult();
		return new SelectComp().get(listPageID,defaultValue,sHomeUrl,dbTypes,
				MdStruc.MdTypeStruc.MODEL_TYPE_ID, MdStruc.MdTypeStruc.MODEL_TYPE_DESC);
	}
}
